<?php
    
?>
<html>
    <head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="../../../Ginecobstetricia/vista/css/bootstrap-combined.min.css" rel="stylesheet">
         
        <script src="../../../vista/reportes/js/jquery-1.5.2.js" type="text/javascript"></script>
        <!-- LIBRERIAS JQUERY PARA LA CREACION DE LAS ALERTAS -->
        <script type="text/javascript" src="../../../Ginecobstetricia/vista/js/alertify.js"></script>
        <link rel="stylesheet" href="../../../Ginecobstetricia/vista/css/alertify.core.css" />
        <link rel="stylesheet" href="../../../Ginecobstetricia/vista/css/alertify.default.css" />
        <style>
            .white {
                border-radius: 5px;
                color: #606060;
                border: solid 1px #b7b7b7;
                background: #fff;
                background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
                background: -moz-linear-gradient(top,  #fff,  #ededed);
                filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed');
                padding: 4px 4px 4px;
                height: 30px;
                font-size: 13px;
            }
            .white:hover {
                background: #ededed;
                background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc));
                background: -moz-linear-gradient(top,  #fff,  #dcdcdc);
                filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc');
            }
            .white:active {
                color: #999;
                background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff));
                background: -moz-linear-gradient(top,  #ededed,  #fff);
                filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff');
            }
            
            /* para las filas impares */
            table tr:nth-child(odd) th {
                background-color: #DAEAFF;
                font-weight: normal;
            }
            /* para las filas paras */
            table tr:nth-child(even) th {
                background-color: #FFFFFF;
                font-weight: normal;
            }
            
            #barras{
                
                width:100%; 
                height:10%;
                border-radius: 0px 0px 5px 5px;
                
                
                /**/
                background:linear-gradient(#B5B5B5, #e8eaeb);
                font-weight: bold;
                position: relative;
                border-radius: 5px 5px 0px 0px;
                
            }
            
            #barras2{
                
                height:10%;
                width:100%;
                border-radius: 0px 0px 5px 5px;
                
                /**/
                background:linear-gradient(#e8eaeb, #B5B5B5);
                font-weight: bold;
                position: relative;
            }
            
        </style>
        <script>
            function hospitalizacion(){
                $.ajax({
                    type: "POST",
                    contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                    url: "../../controlador/php/sql/hospitali.php",
                    success: mostrarDatos,
                    timeout: 4000
                });
            }
            
            function mostrarDatos(datos){
                rpt = $.parseJSON(datos);
                datos = $("#respuesta");
                var resp = "";
                resp += "<table style='font-size:90%;overflow:hidden;border:1px solid #d3d3d3;background:#fefefe;width:100%;-moz-border-radius:5px; /* FF1+ */-webkit-border-radius:5px; /* Saf3-4 */border-radius:5px;-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'>\
                            <tr>\
                                <td align='center' style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                    Documento\
                                </td>\
                                <td align='center' style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                    Ingreso\
                                </td>\
                                <td align='center' style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                    Fecha de Registro\
                                </td>\
                                <td align='center' style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                    Paciente\
                                </td>\
                                <td align='center' style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                    Conducta\
                                </td>\
                                <td align='center' style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                    Registrado por\
                                </td>\
                                <td align='center' style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                    Ver\
                                </td>\
                            </tr>";
                for(r in rpt){
                    resp += "<tr>\
                                <th align='left'>\
                                    "+ rpt[r].Documento +"\
                                </th>\
                                 <th align='left' >\
                                    "+ rpt[r].Ingreso +"\
                                </th>\
                                <th align='left'>\
                                    "+ rpt[r].Fecha_de_Registro +"\
                                </th>\
                                <th align='left'>\
                                    "+ rpt[r].Nombre_Paciente +"\
                                </th>\
                                <th align='left'>\
                                    "+ rpt[r].Conducta +"\
                                </th>\
                                <th align='left'>\
                                    "+ rpt[r].Registrado_por +"\
                                </th>\
                                <th>\
                                       <img src='../../../vista/imagen/des.png' width='20' height='20' alt='des' onclick='cargarP("+ rpt[r].Documento +");'/>\
                                 </th>\
                            </tr>";
                }
                resp += "</table>";
                
                datos.append(resp);
            }
            
            function cargarP(documento){
                window.opener.document.getElementById("documento").value = documento;
                window.opener.cargarPaci();
                window.close();
            }
            function validar(){
                if($("#docume").val()===""){
                 alertify.alert("Digite Documento"),function(){
                    $("#docume").focus();
                };
                return false;
            }
            buscar();
            }
            function buscar(){
            var docume=$("#docume").val();
            
            $.ajax({
                        async: true,
                        type: "POST",
                        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                        url:"../../controlador/php/sql/hospitaliz.php",
                        data:{docume:docume},
                        success:respuesta,
                        timeout: 4000
                        });
            }
            function respuesta(datos){
                $("#respuesta").text("");
                rpt = $.parseJSON(datos);
                datos = $("#respuesta");
                var resp = "";
                resp += "<table style='font-size:90%;overflow:hidden;border:1px solid #d3d3d3;background:#fefefe;width:100%;-moz-border-radius:5px; /* FF1+ */-webkit-border-radius:5px; /* Saf3-4 */border-radius:5px;-moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);-webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'>\
                            <tr>\
                                <td align='center' style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                    Documento\
                                </td>\
                                <td align='center' style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                    Ingreso\
                                </td>\
                                <td align='center' style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                    Fecha de Registro\
                                </td>\
                                <td align='center' style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                    Paciente\
                                </td>\
                                <td align='center' style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                    Conducta\
                                </td>\
                                <td align='center' style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                    Registrado por\
                                </td>\
                                <td align='center' style='padding:10px 10px 10px; text-align:center;border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe)); background:#e8eaeb;'>\
                                    Ver\
                                </td>\
                            </tr>";
                for(r in rpt){
                    resp += "<tr>\
                                <th align='left'>\
                                    "+ rpt[r].Documento +"\
                                </th>\
                                 <th align='left'>\
                                    "+ rpt[r].Ingreso +"\
                                </th>\
                                <th align='left'>\
                                    "+ rpt[r].Fecha_de_Registro +"\
                                </th>\
                                <th align='left'>\
                                    "+ rpt[r].Nombre_Paciente +"\
                                </th>\
                                <th align='left'>\
                                    "+ rpt[r].Conducta +"\
                                </th>\
                                <th align='left'>\
                                    "+ rpt[r].Registrado_por +"\
                                </th>\
                                <th>\
                                       <img src='../../../vista/imagen/des.png' width='20' height='20' alt='des' onclick='cargarP("+ rpt[r].Documento +");'/>\
                                 </th>\
                            </tr>";
                }
                resp += "</table>";
                
                datos.append(resp);
            }
        </script>
    </head>
    <body onload="hospitalizacion();">
        <div align="center" id="barras">
            <table style="width:100%; height:10%;" >
                <td align="center" width="88.3%">
                <div style="padding:1.5%;"><b>PACIENTES HOSPITALIZADAS EN GINECO</b></div>
                </td>
            </table>
        </div>
        <div style='overflow-y: scroll;height:80%;'>
        <div id="respuesta">
        </div>
        </div>
        <div id="barras2">
            <table style="font-size: 75%"  width="100%">
                <tr>
                    <td>
                        BUSCAR:
                    </td>
                    <td>
                        <input type="text" name="" value="" id="docume" placeholder='DOCUMENTO'  onkeyup="buscar();"/>
                    </td>
                    <td width="60%" align="right">
                        <input type="button" value="Cerrar" class="white" onclick="window.close();"/>
                    </td>
                </tr>
            </table>
        </div>
    </body>
</html>
